/**
 * Created by kule on 2017/5/17.
 */
export const genOnceRun=function(fn){
   let runFlag=false;
   let rst;
   const onceRun=function(...args){
       if(runFlag){
           return rst;
       }
       runFlag=true;
       return rst=fn.call(this,...args);
   };
   const reset=()=>{
       runFlag=false;
   };
   onceRun.reset=reset;
   return onceRun;
};
export default genOnceRun;